//
//  DJChartsController.swift
//  dj-learn-Swift
//


import UIKit
import SnapKit

class DJChartsController: UIViewController {

    let pieChartsView = LCProfitPieChartView(frame: .zero)
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.view.backgroundColor = UIColor.gray

        self.view.addSubview(self.pieChartsView)
        self.pieChartsView.snp.makeConstraints { (make) in
            make.edges.equalTo(self.view)
        }
        self.pieChartsView.shadowColor = UIColor(hex: 0xFFFFFF, alpha: 0.1)
        self.pieChartsView.reload(values: [LCProfitPieChartModel(name: "服务费", value: 1000.0, color: UIColor.red),
                                           LCProfitPieChartModel(name: "笔数奖", value: 200.0, color: UIColor.yellow),
                                           LCProfitPieChartModel(name: "开户奖", value: 20.0, color: UIColor.orange),
                                           LCProfitPieChartModel(name: "招商奖", value: 190.0, color: UIColor.green)])
        
        self.pieChartsView.valueSelected = { model in
            print(model.name)
        }
    }
    

}
